10 NUMLAB$="0"
20 BOX=3:GOSUB 9000
30 ROW=20:MSG$="PRINT LABELS ON OKIDATA MICROLINE 182":GOSUB 9300
40 ROW=3:MSG$="1.         1-7/16 BY 4          7 LINES":GOSUB 9300
50 ROW=5:MSG$="2.         15/16 BY 3-1/2       4 LINES":GOSUB 9300
60 ROW=7:MSG$="ESCape     EXIT PROGRAM                ":GOSUB 9300
70 ROW=10:MSG$="1, 2, OR ESC":TEMP$=""
80 LNG=1:GOSUB 9500:KIND$=TEMP$
90 IF EXIT$="ESC" THEN END
100 IF KIND$<>"1" AND KIND$<>"2" THEN 70
110 REM ----- DISPLAY LINES
120 BOX=3:GOSUB 9000
130 IF KIND$="1" THEN MSG$="1-7/16 BY 4 LABEL"
140 IF KIND$="2" THEN MSG$="15/16 BY 3-1/2 LABEL"
150 ROW=20:GOSUB 9300
160 LOCATE 3,3:PRINT "LINE 1";
170 LOCATE 3,14:PRINT "SIZE (L) or (X)L: ";L1$;
180 LOCATE 3,38:PRINT "TEXT: ";LINE1$;
190 LOCATE 5,3:PRINT "LINE 2";
200 LOCATE 5,14:PRINT "SIZE (L) or (X)L: ";L2$;
210 LOCATE 5,38:PRINT "TEXT: ";LINE2$;
220 LOCATE 7,3:PRINT "LINE 3";
230 LOCATE 7,14:PRINT "SIZE (L) or (X)L: ";L3$;
240 LOCATE 7,38:PRINT "TEXT: ";LINE3$;
250 LOCATE 9,3:PRINT "LINE 4";
260 LOCATE 9,14:PRINT "SIZE (L) or (X)L: ";L4$;
270 LOCATE 9,38:PRINT "TEXT: ";LINE4$;
280 REM -----
290 IF KIND$="2" THEN 410
300 REM -----
310 LOCATE 11,3:PRINT "LINE 5";
320 LOCATE 11,14:PRINT "SIZE (L) or (X)L: ";L5$;
330 LOCATE 11,38:PRINT "TEXT: ";LINE5$;
340 LOCATE 13,3:PRINT "LINE 6";
350 LOCATE 13,14:PRINT "SIZE (L) or (X)L: ";L6$;
360 LOCATE 13,38:PRINT "TEXT: ";LINE6$;
370 LOCATE 15,3:PRINT "LINE 7";
380 LOCATE 15,14:PRINT "SIZE (L) or (X)L: ";L7$;
390 LOCATE 15,38:PRINT "TEXT: ";LINE7$;
400 REM ----- EDIT LINES
410 ROW=3:COL=32:LNG=1
420 TEMP$=L1$:GOSUB 10000
430 IF EXIT$="ESC" THEN 1430
440 IF TEMP$<>"X" AND TEMP$<>"L" THEN 420
450 L1$=TEMP$
460 REM
470 ROW=3:COL=44:LOCATE ROW,COL:PRINT SPACE$(34);
480 IF KIND$="1" AND L1$="L" THEN LNG=34
490 IF KIND$="1" AND L1$="X" THEN LNG=17
500 IF KIND$="2" AND L1$="L" THEN LNG=26
510 IF KIND$="2" AND L1$="X" THEN LNG=13
520 TEMP$=LINE1$:GOSUB 10000
530 IF EXIT$="ESC" THEN 1430
540 LINE1$=TEMP$
550 REM -----
560 ROW=5:COL=32:LNG=1
570 TEMP$=L2$:GOSUB 10000
580 IF TEMP$<>"X" AND TEMP$<>"L" THEN 570
590 IF EXIT$="ESC" THEN 1430
600 L2$=TEMP$
610 REM
620 ROW=5:COL=44:LOCATE ROW,COL:PRINT SPACE$(34);
630 IF KIND$="1" AND L2$="L" THEN LNG=34
640 IF KIND$="1" AND L2$="X" THEN LNG=17
650 IF KIND$="2" AND L2$="L" THEN LNG=26
660 IF KIND$="2" AND L2$="X" THEN LNG=13
670 TEMP$=LINE2$:GOSUB 10000
680 LINE2$=TEMP$
690 REM -----
700 ROW=7:COL=32:LNG=1
710 TEMP$=L3$:GOSUB 10000
720 IF TEMP$<>"X" AND TEMP$<>"L" THEN 710
730 IF EXIT$="ESC" THEN 1430
740 L3$=TEMP$
750 REM
760 ROW=7:COL=44:LOCATE ROW,COL:PRINT SPACE$(34);
770 IF KIND$="1" AND L3$="L" THEN LNG=34
780 IF KIND$="1" AND L3$="X" THEN LNG=17
790 IF KIND$="2" AND L3$="L" THEN LNG=26
800 IF KIND$="2" AND L3$="X" THEN LNG=13
810 TEMP$=LINE3$:GOSUB 10000
820 LINE3$=TEMP$
830 REM -----
840 ROW=9:COL=32:LNG=1
850 TEMP$=L4$:GOSUB 10000
860 IF TEMP$<>"X" AND TEMP$<>"L" THEN 850
870 IF EXIT$="ESC" THEN 1430
880 L4$=TEMP$
890 REM
900 ROW=9:COL=44:LOCATE ROW,COL:PRINT SPACE$(34);
910 IF KIND$="1" AND L4$="L" THEN LNG=34
920 IF KIND$="1" AND L4$="X" THEN LNG=17
930 IF KIND$="2" AND L4$="L" THEN LNG=26
940 IF KIND$="2" AND L4$="X" THEN LNG=13
950 TEMP$=LINE4$:GOSUB 10000
960 LINE4$=TEMP$
970 REM -----
980 IF KIND$="2" THEN 1430
990 REM -----
1000 ROW=11:COL=32:LNG=1
1010 TEMP$=L5$:GOSUB 10000
1020 IF TEMP$<>"X" AND TEMP$<>"L" THEN 1010
1030 IF EXIT$="ESC" THEN 1430
1040 L5$=TEMP$
1050 REM
1060 ROW=11:COL=44:LOCATE ROW,COL:PRINT SPACE$(34);
1070 IF KIND$="1" AND L5$="L" THEN LNG=34
1080 IF KIND$="1" AND L5$="X" THEN LNG=17
1090 IF KIND$="2" AND L5$="L" THEN LNG=26
1100 IF KIND$="2" AND L5$="X" THEN LNG=13
1110 TEMP$=LINE5$:GOSUB 10000
1120 LINE5$=TEMP$
1130 REM -----
1140 ROW=13:COL=32:LNG=1
1150 TEMP$=L6$:GOSUB 10000
1160 IF TEMP$<>"X" AND TEMP$<>"L" THEN 1150
1170 IF EXIT$="ESC" THEN 1430
1180 L6$=TEMP$
1190 REM
1200 ROW=13:COL=44:LOCATE ROW,COL:PRINT SPACE$(34);
1210 IF KIND$="1" AND L6$="L" THEN LNG=34
1220 IF KIND$="1" AND L6$="X" THEN LNG=17
1230 IF KIND$="2" AND L6$="L" THEN LNG=26
1240 IF KIND$="2" AND L6$="X" THEN LNG=13
1250 TEMP$=LINE6$:GOSUB 10000
1260 LINE6$=TEMP$
1270 REM -----
1280 ROW=15:COL=32:LNG=1
1290 TEMP$=L7$:GOSUB 10000
1300 IF TEMP$<>"X" AND TEMP$<>"L" THEN 1290
1310 IF EXIT$="ESC" THEN 1430
1320 L7$=TEMP$
1330 REM
1340 ROW=15:COL=44:LOCATE ROW,COL:PRINT SPACE$(34);
1350 IF KIND$="1" AND L7$="L" THEN LNG=34
1360 IF KIND$="1" AND L7$="X" THEN LNG=17
1370 IF KIND$="2" AND L7$="L" THEN LNG=26
1380 IF KIND$="2" AND L7$="X" THEN LNG=13
1390 TEMP$=LINE7$:GOSUB 10000
1400 LINE7$=TEMP$
1410 REM -----
1420 REM -----
1430 ROW=19:GOSUB 9200
1440 ROW=20:MSG$="PRINT HOW MANY LABELS (ESCape to EXIT)":TEMP$=NUMLAB$:TYP=2
1450 LNG=2:GOSUB 9500
1460 IF EXIT$="ESC" THEN 20
1470 NUMLAB$=TEMP$:NUMLAB=VAL(NUMLAB$)
1475 IF NUMLAB=0 THEN 1440
1480 REM -----
1490 LOCATE 20,2:PRINT SPACE$(78);
1500 ROW=19:MSG$="HIT ANY KEY TO EXIT":GOSUB 9300
1510 FOR NUMLOOP=1 TO NUMLAB
1520 IN$=INKEY$:IF IN$<>"" THEN 1430
1530 ROW=20:MSG$="PRINTING LABEL #"+STR$(NUMLOOP):GOSUB 9300
1540 REM -----
1550 IF L1$="L" THEN GOSUB 1870 ELSE GOSUB 1830
1560 LPRINT LINE1$
1570 IF L1$="L" THEN GOSUB 1900 ELSE GOSUB 1850
1580 IF L2$="L" THEN GOSUB 1870 ELSE GOSUB 1830
1590 LPRINT LINE2$
1600 IF L2$="L" THEN GOSUB 1900 ELSE GOSUB 1850
1610 IF L3$="L" THEN GOSUB 1870 ELSE GOSUB 1830
1620 LPRINT LINE3$
1630 IF L3$="L" THEN GOSUB 1900 ELSE GOSUB 1850
1640 IF L4$="L" THEN GOSUB 1870 ELSE GOSUB 1830
1650 LPRINT LINE4$
1660 IF L4$="L" THEN GOSUB 1900 ELSE GOSUB 1850
1670 REM -----
1680 IF KIND$="2" THEN 1790
1690 REM -----
1700 IF L5$="L" THEN GOSUB 1870 ELSE GOSUB 1830
1710 LPRINT LINE5$
1720 IF L5$="L" THEN GOSUB 1900 ELSE GOSUB 1850
1730 IF L6$="L" THEN GOSUB 1870 ELSE GOSUB 1830
1740 LPRINT LINE6$
1750 IF L6$="L" THEN GOSUB 1900 ELSE GOSUB 1850
1760 IF L7$="L" THEN GOSUB 1870 ELSE GOSUB 1830
1770 LPRINT LINE7$
1780 IF L7$="L" THEN GOSUB 1900 ELSE GOSUB 1850
1790 LPRINT:LPRINT
1800 NEXT NUMLOOP
1810 GOTO 1430
1820 REM -----
1830 LPRINT CHR$(27);"G";CHR$(27);"E";CHR$(27);"W1";    :REM LARGE CHAR.(41 CPL)
1840 RETURN
1850 LPRINT CHR$(27);"H";CHR$(27);"F";CHR$(27);"W0";    :REM LARGE CHAR. OFF
1860 RETURN
1870 LPRINT CHR$(27);"G";                               :REM ENHANCED
1880 LPRINT CHR$(27);"E";                               :REM EMPHASIZED
1890 RETURN
1900 LPRINT CHR$(27);"H";                               :REM ENHANCED OFF
1910 LPRINT CHR$(27);"F";                               :REM ENHANCED OFF
1920 RETURN
1930 REM ----------------
8945 REM *********************************************************************
8950 REM --------------------- OUTLINE THE SCREEN ----------------------------
8955 REM
8960 REM This subroutines allows you to outline the screen with your
8965 REM choice of 4 types of boxes. Boxes 1,2, and 3 are the same
8970 REM types of boxes used in other subroutines.
8975 REM
8980 REM enter with - BOX = 0,1,2,3 - type of box to outline the screen with
8985 REM              0=squares, 1=1 line box, 2=2 line box, 3=solid box
8990 REM exit with -  BOX=0 (to maintain BOX as optional for other routines)
8995 REM
9000 IF TEXTFORE=0 AND TEXTBACK=0 THEN TEXTFORE=7                    :REM 9000
9005 IF DATAFORE=0 AND DATABACK=0 THEN DATAFORE=15
9010 IF FIELDFORE=0 AND FIELDBACK=0 THEN FIELDBACK=7
9015 KEY OFF:COLOR TEXTFORE,TEXTBACK:CLS:LOCATE ,,0
9020 IF BOX=0 THEN TP=254:BT=254:MS=254:UL=254:LL=254:UR=254:LR=254
9025 IF BOX=1 THEN TP=196:BT=196:MS=179:UL=218:LL=192:UR=191:LR=217
9030 IF BOX=2 THEN TP=205:BT=205:MS=186:UL=201:LL=200:UR=187:LR=188
9035 IF BOX=3 THEN TP=223:BT=220:MS=219:UL=219:LL=219:UR=219:LR=219
9040 ROW=1:LOCATE ROW,2:PRINT STRING$(78,CHR$(TP));
9045 ROW=25:LOCATE ROW,2:PRINT STRING$(78,CHR$(BT));
9050 COL=1:FOR ROW=2 TO 24:LOCATE ROW,COL:PRINT CHR$(MS);:NEXT
9055 COL=80:FOR ROW=2 TO 24:LOCATE ROW,COL:PRINT CHR$(MS);:NEXT
9060 LOCATE 1,1:PRINT CHR$(UL);:LOCATE 1,80:PRINT CHR$(UR);
9065 LOCATE 25,1:PRINT CHR$(LL);:LOCATE 25,80:PRINT CHR$(LR);
9070 BOX=0:RETURN
9075 REM
9080 REM
9145 REM *********************************************************************
9150 REM ------------------------- ERASE LINE --------------------------------
9155 REM
9160 REM This subroutine will erase the line of your choice from col. 2 to 79
9165 REM
9170 REM
9175 REM enter with - ROW=line to erase
9180 REM optional -   TEXTFORE,TEXTBACK,DATAFORE,DATABACK,FIELDFORE,FIELDBACK
9185 REM              colors optionally specified for COLOR statements
9190 REM
9195 REM
9200 IF TEXTFORE=0 AND TEXTBACK=0 THEN TEXTFORE=7                    :REM 9200
9205 IF DATAFORE=0 AND DATABACK=0 THEN DATAFORE=15
9210 IF FIELDFORE=0 AND FIELDBACK=0 THEN FIELDBACK=7
9215 COLOR TEXTFORE,TEXTBACK
9220 LOCATE ROW,2,0:PRINT SPACE$(78);
9225 RETURN
9230 REM
9235 REM *********************************************************************
9240 REM ------------------- CENTER A MESSAGE IN ROW -------------------------
9245 REM
9250 REM This subroutine allows you to center a message in a particular row
9255 REM and automatically makes adjustments to the column for centering.
9260 REM
9265 REM
9270 REM enter with - MSG$="message", to display (up to 74 characters)
9275 REM              ROW=ROW (on which to display message)
9280 REM optional -   BOX=0,1,2,3 - type of box to draw around MSG$
9285 REM              0 = no box, 1 = 1 line, 2 = 2 line, 3 = solid
9290 REM exit with -  BOX=0 (to maintain BOX as optional for other routines)
9295 REM
9300 COL=41-INT((LEN(MSG$)/2))                                       :REM 9300
9305 GOSUB 9700:REM display message at row,col       :REM SUBROUTINE USED HERE
9310 RETURN                 
9315 REM
9425 REM *********************************************************************
9430 REM ------------ CENTER A MESSAGE AND FIELD EDIT IN ROW -----------------
9435 REM
9440 REM This subroutine allows you to center a message along with a field to
9445 REM enter or edit in a particular row, and automatically makes adjust-
9450 REM ments to the column for centering.
9455 REM
9460 REM enter with - MSG$="message", to display
9465 REM              everything required or optionally required with the
9470 REM              EDIT A FIELD AT ROW AND COLUMN routine except COL
9475 REM              NOTE: length of MSG$+LNG must be <=72 characters
9480 REM exit with -  everything returned with
9485 REM              EDIT A FIELD AT ROW AND COLUMN routine
9490 REM
9495 REM
9500 COL=41-(INT((LEN(MSG$)/2))+1+(LNG/2))                           :REM 9500
9505 MSG$=MSG$+SPACE$(LNG+2)
9510 GOSUB 9700:REM display message at row,col       :REM SUBROUTINE USED HERE
9515 MSG$=LEFT$(MSG$,LEN(MSG$)-LNG-2)
9520 COL=COL+LEN(MSG$)+2
9525 GOSUB 10000:REM edit field                      :REM SUBROUTINE USED HERE
9530 RETURN
9535 REM
9540 REM
9620 REM *********************************************************************
9625 REM ---------------- DISPLAY MESSAGE AT ROW AND COLUMN ------------------
9630 REM
9635 REM This subroutine allows you to display a message at a specified
9640 REM row and column and optionally draw a box around it. If drawing
9645 REM the box would mean trying to print to an illegal row or column,
9650 REM the box is not drawn.
9655 REM
9660 REM enter with - MSG$="message", to display (up to 74 characters)
9665 REM              ROW and COL=row and column on which to display "message"
9670 REM optional-    BOX=0,1,2,3 - type of box to draw around MSG$
9675 REM              0 = no box, 1 = 1 line, 2 = 2 line, 3 = solid
9680 REM optional -   TEXTFORE,TEXTBACK,DATAFORE,DATABACK,FIELDFORE,FIELDBACK
9685 REM              colors optionally specified for COLOR statements
9690 REM exit with -  BOX=0 (to maintain BOX as optional for other routines)
9695 REM
9700 IF TEXTFORE=0 AND TEXTBACK=0 THEN TEXTFORE=7                    :REM 9700
9705 IF DATAFORE=0 AND DATABACK=0 THEN DATAFORE=15
9710 IF FIELDFORE=0 AND FIELDBACK=0 THEN FIELDBACK=7
9715 COLOR TEXTFORE,TEXTBACK
9720 LOCATE ROW,COL,0:PRINT MSG$;:L=LEN(MSG$)
9725 IF ROW<2 OR ROW>24 THEN 9790
9730 IF COL<3 OR LEN(MSG$)>74 THEN 9790
9735 IF BOX=0 THEN 9790
9740 LOCATE ROW,COL-1:PRINT " ";
9745 LOCATE ROW,COL+LEN(MSG$):PRINT " ";
9750 IF BOX=1 THEN TP=196:BT=196:MS=179:UL=218:LL=192:UR=191:LR=217
9755 IF BOX=2 THEN TP=205:BT=205:MS=186:UL=201:LL=200:UR=187:LR=188
9760 IF BOX=3 THEN TP=223:BT=220:MS=219:UL=219:LL=219:UR=219:LR=219
9765 LOCATE ROW+1,COL-2:PRINT CHR$(LL);:LOCATE ROW,COL-2:PRINT CHR$(MS);
9770 LOCATE ROW-1,COL-2:PRINT CHR$(UL);:LOCATE ROW-1,COL+L+1:PRINT CHR$(UR);
9775 LOCATE ROW,COL+L+1:PRINT CHR$(MS);:LOCATE ROW+1,COL+L+1:PRINT CHR$(LR);
9780 LOCATE ROW-1,COL-1:PRINT STRING$(L+2,CHR$(TP));
9785 LOCATE ROW+1,COL-1:PRINT STRING$(L+2,CHR$(BT));
9790 BOX=0:RETURN
9795 REM
9800 REM
9805 REM
9810 REM
9815 REM
9820 REM
9825 REM *********************************************************************
9830 REM ---------------- EDIT A FIELD AT ROW AND COLUMN ---------------------
9835 REM
9840 REM This subroutine allows you to edit or enter a string of up to 74
9845 REM characters at a specified row and column. It allows you to specify
9850 REM the maximum length of the string and allows you to optionally draw
9855 REM a box around the editing area. The editing keys perform about the
9860 REM same functions as when using BASIC in the screen editing mode.
9865 REM
9870 REM enter with - ROW and COL=row and column at which to edit the string
9875 REM              LNG=maximum length of string allowed (up to 74)
9880 REM              TEMP$="string" to edit
9885 REM optional -   EDCOL=0,1
9890 REM              0 = begin editing at beginning of string
9895 REM              else begin editing at end of string
9900 REM optional -   EDKEYS=0,1,2 - what keys allow you to exit the routine
9905 REM              0 = only ENTER or ESCAPE
9910 REM              1 = include PGUP, PGDN, UP, DOWN, LEFT, RIGHT ARROWS
9915 REM              2 = include F1-F10
9920 REM optional -   TYP=0,1,2 - type of input desired
9925 REM              0 = normal ALPHANUMERIC
9930 REM              1 = ALPHANUMERIC with lower case changed to upper case
9935 REM              2 = NUMERIC only allowed
9940 REM optional -   BOX=0,1,2,3 - type of box to draw around MSG$
9945 REM              0 = no box, 1 = 1 line, 2 = 2 line, 3 = solid
9950 REM optional -   TEXTFORE,TEXTBACK,DATAFORE,DATABACK,FIELDFORE,FIELDBACK
9955 REM              colors optionally specified for COLOR statements
9960 REM exit with -  TEMP$="string" edited or entered
9965 REM              BOX=0,TYP=0,EDKEYS=0,EDCOL=0 (to maintain these as opt.)
9970 REM              EXIT$=key hit that exited routine-
9975 REM              (EXIT$="ENTER" if field was completely filled)
9980 REM              "LEFT" if LEFT ARROW when at left side of field
9985 REM              "RIGHT" if RIGHT ARROW when at right side of field
9990 REM              "UP","DOWN","PGUP","PGDN","F1"-"F10","ENTER","ESC"
9995 REM
10000 IF TEXTFORE=0 AND TEXTBACK=0 THEN TEXTFORE=7                  :REM 10000
10005 IF DATAFORE=0 AND DATABACK=0 THEN DATAFORE=15
10010 IF FIELDFORE=0 AND FIELDBACK=0 THEN FIELDBACK=7
10015 IF LNG=0 THEN LNG=1
10020 INS=0:EXIT$="":TEMP$=LEFT$(TEMP$,LNG)
10025 IF EDCOL=0 THEN EDCOL=COL:GOTO 10035
10030 IF LEN(TEMP$)=LNG THEN EDCOL=COL+LEN(TEMP$)-1 ELSE EDCOL=COL+LEN(TEMP$)
10035 LOCATE ROW,COL,1:COLOR FIELDFORE,FIELDBACK:PRINT TEMP$;
10040 LOCATE ROW,COL+LEN(TEMP$):PRINT SPACE$(LNG-LEN(TEMP$));
10045 L=LEN(TEMP$)
10050 IF ROW<2 OR ROW>24 THEN 10115
10055 IF COL<3 OR LNG>74 THEN 10115
10060 IF BOX=0 THEN 10115
10065 IF BOX=1 THEN TP=196:BT=196:MS=179:UL=218:LL=192:UR=191:LR=217
10070 IF BOX=2 THEN TP=205:BT=205:MS=186:UL=201:LL=200:UR=187:LR=188
10075 IF BOX=3 THEN TP=223:BT=220:MS=219:UL=219:LL=219:UR=219:LR=219
10080 COLOR TEXTFORE,TEXTBACK
10085 LOCATE ROW+1,COL-2:PRINT CHR$(LL);:LOCATE ROW,COL-2:PRINT CHR$(MS);
10090 LOCATE ROW-1,COL-2:PRINT CHR$(UL);:LOCATE ROW-1,COL+LNG+1:PRINT CHR$(UR);
10095 LOCATE ROW,COL+LNG+1:PRINT CHR$(MS);
10100 LOCATE ROW+1,COL+LNG+1:PRINT CHR$(LR);
10105 LOCATE ROW-1,COL-1:PRINT STRING$(LNG+2,CHR$(TP));
10110 LOCATE ROW+1,COL-1:PRINT STRING$(LNG+2,CHR$(BT));
10115 BOX=0
10120 AAAA$=MID$(TEMP$,EDCOL-COL+1,1)                      :REM --------------
10125 IF INS THEN LOCATE ROW,EDCOL:COLOR DATAFORE,DATABACK :REM    editing   |
10130 IF INS THEN PRINT AAAA$;:COLOR FIELDFORE,FIELDBACK   :REM     keys     |
10135 LOCATE ROW,EDCOL                                     :REM   available  |
10140 IN$=INKEY$:IF IN$="" THEN 10140                      :REM --------------
10145 IF IN$=CHR$(13) THEN EXIT$="ENTER":GOTO 10610        :REM ENTER        |
10150 IF IN$=CHR$(27) THEN EXIT$="ESC":GOTO 10610          :REM ESCAPE       |
10155 IF IN$=CHR$(8) THEN 10420                            :REM BACKSPACE    |
10160 IF IN$=CHR$(0)+CHR$(71) THEN 10465                   :REM HOME         |
10165 IF IN$=CHR$(0)+CHR$(119) THEN 10475                  :REM CONTROL HOME |
10170 IF IN$=CHR$(0)+CHR$(75) THEN 10485                   :REM LEFT ARROW   |
10175 IF IN$=CHR$(0)+CHR$(77) THEN 10505                   :REM RIGHT ARROW  |
10180 IF IN$=CHR$(0)+CHR$(79) THEN 10545                   :REM END          |
10185 IF IN$=CHR$(0)+CHR$(117) THEN 10565                  :REM CONTROL END  |
10190 IF IN$=CHR$(0)+CHR$(82) THEN 10575                   :REM INSERT       |
10195 IF IN$=CHR$(0)+CHR$(83) THEN 10585                   :REM DELETE       |
10200 IF EDKEYS=0 THEN 10290                               :REM skip these - |
10205 IF IN$=CHR$(0)+CHR$(72) THEN EXIT$="UP":GOTO 10610   :REM UP ARROW     |
10210 IF IN$=CHR$(0)+CHR$(80) THEN EXIT$="DOWN":GOTO 10610 :REM DOWN ARROW   |
10215 IF IN$=CHR$(0)+CHR$(73) THEN EXIT$="PGUP":GOTO 10610 :REM PAGE UP      |
10220 IF IN$=CHR$(0)+CHR$(81) THEN EXIT$="PGDN":GOTO 10610 :REM PAGE DOWN    |
10225 REM                                                  :REM HOME         |
10230 REM                                                  :REM END          |
10235 IF EDKEYS=1 THEN 10290                               :REM skip these - |
10240 IF IN$=CHR$(0)+CHR$(59) THEN EXIT$="F1":GOTO 10610   :REM F1           |
10245 IF IN$=CHR$(0)+CHR$(60) THEN EXIT$="F2":GOTO 10610   :REM F2           |
10250 IF IN$=CHR$(0)+CHR$(61) THEN EXIT$="F3":GOTO 10610   :REM F3           |
10255 IF IN$=CHR$(0)+CHR$(62) THEN EXIT$="F4":GOTO 10610   :REM F4           |
10260 IF IN$=CHR$(0)+CHR$(63) THEN EXIT$="F5":GOTO 10610   :REM F5           |
10265 IF IN$=CHR$(0)+CHR$(64) THEN EXIT$="F6":GOTO 10610   :REM F6           |
10270 IF IN$=CHR$(0)+CHR$(65) THEN EXIT$="F7":GOTO 10610   :REM F7           |
10275 IF IN$=CHR$(0)+CHR$(66) THEN EXIT$="F8":GOTO 10610   :REM F8           |
10280 IF IN$=CHR$(0)+CHR$(67) THEN EXIT$="F9":GOTO 10610   :REM F9           |
10285 IF IN$=CHR$(0)+CHR$(68) THEN EXIT$="F10":GOTO 10610  :REM F10          |
10290 IF TYP=0 OR TYP=1 THEN 10310                         :REM --------------
10295 REM ----- allow only numbers
10300 IF ASC(IN$)<48 OR ASC(IN$)>57 THEN GOSUB 10660:GOTO 10140
10305 REM ----- allow only legitimate alphanumeric
10310 IF ASC(IN$)<32 OR ASC(IN$)>126 THEN GOSUB 10660:GOTO 10140
10315 REM ----- change to all upper case
10320 IF TYP<>1 THEN 10335
10325 IF ASC(IN$)>=97 AND ASC(IN$)<=122 THEN IN$=CHR$(ASC(IN$)-32)
10330 REM ----- good character
10335 L=EDCOL-COL:IF INS THEN 10380
10340 REM ----- add char. if at end of string
10345 IF EDCOL=COL+LEN(TEMP$) THEN TEMP$=TEMP$+IN$:GOTO 10395
10350 REM ----- add char. in middle if not in insert mode
10355 TEMP$=LEFT$(TEMP$,L)+IN$+RIGHT$(TEMP$,LEN(TEMP$)-1-L)
10360 REM ----- exit if overwriting last character
10365 IF EDCOL=COL+LNG-1 AND LEN(TEMP$)=LNG THEN EXIT$="ENTER":GOTO 10610
10370 GOTO 10395
10375 REM ----- in insert mode, check for full field
10380 IF LEN(TEMP$)=LNG THEN GOSUB 10660:GOTO 10035            :REM full field
10385 TEMP$=LEFT$(TEMP$,L)+IN$+RIGHT$(TEMP$,LEN(TEMP$)-L)      :REM not full
10390 REM ----- move cursor right if applicable
10395 IF EDCOL<COL+LNG-1 THEN EDCOL=EDCOL+1:GOTO 10035
10400 REM ----- exit if entering last character
10405 EXIT$="ENTER":GOTO 10610
10410 REM ----- BACKSPACE -----
10415 REM ----- error if at leftmost column
10420 IF EDCOL=COL THEN GOSUB 10660:GOTO 10035
10425 REM ----- skip moving cursor left if the field is full
10430 IF LEN(TEMP$)=LNG AND EDCOL=COL+LNG-1 THEN 10455
10435 REM ----- normal backspace (in middle of field)
10440 L=EDCOL-1-COL:TEMP$=LEFT$(TEMP$,L)+RIGHT$(TEMP$,LEN(TEMP$)-1-L)
10445 EDCOL=EDCOL-1:GOTO 10035
10450 REM ----- backspace if at rightmost column
10455 TEMP$=LEFT$(TEMP$,LEN(TEMP$)-1):GOTO 10035
10460 REM ----- HOME -----
10465 INS=0:EDCOL=COL:GOTO 10035
10470 REM ----- CONTROL HOME -----
10475 INS=0:TEMP$="":EDCOL=COL:GOTO 10035
10480 REM ----- LEFT ARROW -----
10485 INS=0:IF EDCOL>COL THEN EDCOL=EDCOL-1:GOTO 10035
10490 IF EDKEYS=0 THEN GOSUB 10660:GOTO 10035           :REM error if left col
10495 EXIT$="LEFT":GOTO 10610                           :REM or exit
10500 REM ----- RIGHT ARROW -----
10505 INS=0:IF EDCOL<COL+LNG-1 THEN 10525
10510 IF EDKEYS=0 THEN GOSUB 10660:GOTO 10035          :REM error if right col
10515 EXIT$="RIGHT":GOTO 10610                         :REM or exit
10520 REM ----- move cursor right if applicable
10525 IF EDCOL<COL+LEN(TEMP$) THEN EDCOL=EDCOL+1:GOTO 10035
10530 REM add "blank" character when cursor is moved to right
10535 TEMP$=TEMP$+CHR$(255):EDCOL=EDCOL+1:GOTO 10035
10540 REM ----- END -----
10545 INS=0:IF LEN(TEMP$)=LNG THEN EDCOL=COL+LEN(TEMP$)-1:GOTO 10035
10550 EDCOL=COL+LEN(TEMP$):GOTO 10035
10555 REM:END:IF EDCOL>COL+LNG THEN EDCOL=COL+LNG:GOTO 10025
10560 REM ----- CONTROL END -----
10565 INS=0:TEMP$=LEFT$(TEMP$,EDCOL-COL):GOTO 10035
10570 REM ----- INSERT -----
10575 IF INS THEN INS=0:GOTO 10035 ELSE INS=-1:GOTO 10035
10580 REM ----- DELETE -----
10585 INS=0:L=EDCOL-COL
10590 REM:IF EDCOL=COL+LNG-1 THEN GOSUB 10515:GOTO 10025:REM needed?
10595 IF EDCOL>=COL+LEN(TEMP$) THEN GOSUB 10660:GOTO 10035
10600 TEMP$=LEFT$(TEMP$,L)+RIGHT$(TEMP$,LEN(TEMP$)-L-1):GOTO 10035
10605 REM ----- COMMON EXIT -----
10610 BLANK$=CHR$(255):REM remove blanks at end
10615 IF RIGHT$(TEMP$,1)=BLANK$ THEN TEMP$=LEFT$(TEMP$,LEN(TEMP$)-1):GOTO 10615
10620 FOR BLANKLOOP=1 TO LEN(TEMP$):REM change blanks in middle to spaces
10625   IF MID$(TEMP$,BLANKLOOP,1)=CHR$(255) THEN MID$(TEMP$,BLANKLOOP,1)=" "
10630 NEXT BLANKLOOP
10635 LOCATE ROW,COL,0:COLOR TEXTFORE,TEXTBACK
10640 PRINT TEMP$+SPACE$(LNG-LEN(TEMP$));
10645 BOX=0:TYP=0:EDKEYS=0:EDCOL=0:RETURN
10650 REM
10655 REM ----- BEEP IF ERROR -----
10660 BEEP:RETURN
10665 REM
10670 REM
